package demo.controller.interceptor;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

import static com.jfinal.kit.PropKit.get;


public class LoginValidator extends Validator {
    protected void validate(Controller c) {
        validateRequiredString("username", "nameMsg", "请输入用户名");
        validateRequiredString("password", "passMsg", "请输入密码");
    }
    protected void handleError(Controller c) {
        System.out.println("进入了校验器");
        c.keepPara("username");
        c.keepPara("password");
        c.render("/all/student/login.html");
    }
}